#ifndef TLD_TIMER_H
#define	TLD_TIMER_H

#include <cstdlib>
#include <nds.h> 

typedef struct TLD_timer_task_struct TLD_timer_task;


	  /*
         Type: TLD_timer_task_action
         The header of a function for execution. *Must be void!*
      */
typedef void ( *TLD_timer_task_action)(void);
      /*
         Struct: TLD_timer_task
         The timer_task struct contains a pointer to the funtion and msec to wait.
		 
		    msecs - The time to wait for execution
			f - The to be executed function
      */
struct TLD_timer_task_struct {
	TLD_timer_task *next;
	TLD_timer_task *prev;
	int msecs;
	TLD_timer_task_action f;
};




void TLD_timer_start();

void TLD_timer_stop();

void TLD_timer_addTask(int ms, TLD_timer_task_action f);

void TLD_timer_removeTask(TLD_timer_task *t);

void TLD_timer_update();

void TLD_timer_paused(void);




#endif
